# -*- coding: utf-8 -*-

from flask import Flask,request,g,render_template

from actions import indexAction,weixinAction,userAction,incomeAction


Default_App_Name = "zjkPython"

Default_Modules = (
	(indexAction,""),
	(weixinAction,"/weixin"),
	(userAction,"/admin"),
	(incomeAction,"/income")
)

def create_app():
	app = Flask(Default_App_Name)
	app.debug = True
	setting_modules(app,Default_Modules)
	return app


def setting_modules(app,modules):
	""" 注册Blueprint模块 """
	for module, url_prefix in modules:
		# 通过register_blueprint注册
		app.register_blueprint(module, url_prefix = url_prefix)